<include file="public@header" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:url('store/index')}">列表</a></li>
            <li class="active"><a href="{:url('store/add')}">添加</a></li>
        </ul>
        <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('store/add')}">
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>店铺名称</label>
                <div class="col-md-6 col-sm-10">
                    <input type="text" class="form-control" name="name">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>Logo</label>
                <div class="col-md-6 col-sm-10">
                    <input type="hidden" name="logo" class="form-control" value="" id="logo">
                    <div>
                        <a href="javascript:uploadOneImage('上传图片','#logo');">
                            <img src="/themes/admin_default/public/assets/images/default-thumbnail.png" id="logo-preview" width="135" style="cursor: pointer">
                        </a>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>店铺地址</label>
                <div class="col-md-6 col-sm-10">
                    <input type="text" class="form-control" name="address">
                    <a onclick="doSelectLocation(this)">选择地址</a>
                    <input type="hidden" name="lat">
                    <input type="hidden" name="lng">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="checkbox">店铺类型</label>
                <div class="col-md-8 col-sm-10">
                    <foreach name="type_list" item="l">
                        <label class="checkbox-inline">
                            <input type="checkbox" name="type_ids[]" value="{$l.id}">{$l.title}
                        </label>
                    </foreach>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>联系人</label>
                <div class="col-md-6 col-sm-10">
                    <input type="text" class="form-control" name="contacts">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>联系电话</label>
                <div class="col-md-6 col-sm-10">
                    <input type="text" class="form-control" name="contact_number">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="form-required">*</span>营业执照</label>
                <div class="col-md-6 col-sm-10">
                    <input type="hidden" name="business_license" class="form-control" value="" id="business_license">
                    <div>
                        <a href="javascript:uploadOneImage('上传图片','#business_license');">
                            <img src="/themes/admin_default/public/assets/images/default-thumbnail.png" id="business_license-preview" width="135" style="cursor: pointer">
                        </a>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="checkbox">是否我店优选</label>
                <div class="col-md-8 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="is_youxuan" value="1">是
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="is_youxuan" value="0" checked>否
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="radio2">状态</label>
                <div class="col-md-8 col-sm-10">
                    <label class="radio-inline">
                        <input type="radio" name="status" value="1" checked="">开启
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="status" value="0">关闭
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                </div>
            </div>
        </form>
    </div>
    <script src="__STATIC__/js/admin.js"></script>
    <script type="text/javascript">
    function doSelectLocation(obj) {
        var $obj       = $(obj);
        var title      = $obj.data('title');
        var $realInput = $obj;
        var location   = $realInput.val();

        openIframeLayer(
            "{:url('store/map')}?location=" + location,
            '选择定位',
            {
                area: ['700px', '90%'],
            }
        );
    }
    </script>
</body>
</html>